package com.itheima.zuoye.d08;

public class GoldenCard extends Card{
    public GoldenCard(int id, double balance) {
        super(id, balance);
    }

    public GoldenCard() {
    }

    @Override
    public void pay(double amount) {
            if (amount <= getBalance()) {
                setBalance(getBalance() - amount*0.8); // 减去支付金额
                System.out.println("金卡支付成功，支付金额：" + amount + "，当前余额：" + getBalance());
            } else {
                System.out.println("余额不足，支付失败！");
            }
        }

    }

